﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using CMS.BLL;

public partial class Controls_Tour_ctrTourDestDetails : System.Web.UI.UserControl
{
    private int nCurrentLang = Support.GetCurrentLanguage();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            initData();
        }
    }

    private void initData()
    {
        int nItemID = ConvertData.ConvertToInt(Request.QueryString[Config.TOUR_DES]);
        
        if (nItemID > 0)
        {
            TourDestination objTourDest = new TourDestination();
            objTourDest.LoadById(nItemID);

            imgImageDesTour.ImageUrl = Config.ROOT + Config.IMAGE_TOURDESTINATION_UPLOAD + objTourDest.Data.Image;
            switch (nCurrentLang)
            {
                case 1:
                    lblTitle.Text = objTourDest.Data.TourDestinationTitle1;
                    ltrTourDest.Text = objTourDest.Data.TourDestinationDetail1;
                    break;
                case 2:
                    ltrTourDest.Text = objTourDest.Data.TourDestinationDetail2;
                    lblTitle.Text = objTourDest.Data.TourDestinationTitle2;
                    break;
                case 3:
                    ltrTourDest.Text = objTourDest.Data.TourDestinationDetail3;
                    lblTitle.Text = objTourDest.Data.TourDestinationTitle3;
                    break;
            }
        }
        else
        {
            Response.Redirect("~/Default.aspx");
        }
    }
}